from django.contrib import admin

from app.admin import SimpleModelAdmin
from money.models import *


@admin.register(MoneyIo)
class MoneyIoAdmin(SimpleModelAdmin):
    list_display = ['pk', 'amount', 'amount_total', 'amount_current', 'bill_type', 'notes']
    list_display_links = ['pk', 'amount']
    search_fields = ['notes', 'id']
    list_filter = ['bill_type']


@admin.register(PayRecord)
class PayRecordAdmin(SimpleModelAdmin):
    readonly_fields = ['user']
    list_display = [
        'pk', 'out_trade_no', 'is_payed', 'user', 'body', 'pay_type', 'total_fee',
        'datetime_created', 'datetime_updated']
    list_display_links = ['pk', 'out_trade_no']
    search_fields = ['out_trade_no', 'id', 'openid', 'user__id', 'body']
    list_filter = ['is_payed']
